package org.scirp.ijmis.service.common.impl;

import java.util.List;

import org.scirp.ijmis.dao.common.ISurveyChoiceDAO;
import org.scirp.ijmis.po.common.SurveyChoice;
import org.scirp.ijmis.service.common.ISurveyChoiceService;

public class SurveyChoiceServiceImpl implements ISurveyChoiceService {
	private ISurveyChoiceDAO surveyChoiceDAO;

	@Override
	public List<SurveyChoice> selectAll() {
		return surveyChoiceDAO.selectAll();
	}

	@Override
	public SurveyChoice selectById(Object id) {
		return surveyChoiceDAO.selectById(id);
	}
	public List<SurveyChoice> selectBySurveyId(Long surveyId){
		return surveyChoiceDAO.selectBySurveyId(surveyId);
	}
	@Override
	public SurveyChoice deleteSurveyChoice(SurveyChoice surveyChoice) {
		return surveyChoiceDAO.deleteSurveyChoice(surveyChoice);
	}
	
	@Override
	public boolean deleteSurveyChoiceById(Long surveyChoiceId) {
		return surveyChoiceDAO.deleteSurveyChoiceById(surveyChoiceId);
	}
	
	@Override
	public boolean deleteSurveyChoiceBySurveyId(Long surveyId) {
		return surveyChoiceDAO.deleteSurveyChoiceBySurveyId(surveyId);
	}
	
	@Override
	public boolean updateSurveyChoice(SurveyChoice surveyChoice) {
		return surveyChoiceDAO.updateSurveyChoice(surveyChoice);
	}
	public boolean updateSurveyChoice(List<SurveyChoice> surveyChoices) {
		boolean flag=true;
		for (SurveyChoice surveyChoice2 : surveyChoices) {
			flag=flag&&surveyChoiceDAO.updateSurveyChoice(surveyChoice2);
		}
		return flag;
	}
	
	public ISurveyChoiceDAO getSurveyChoiceDAO() {
		return surveyChoiceDAO;
	}

	public void setSurveyChoiceDAO(ISurveyChoiceDAO surveyChoiceDAO) {
		this.surveyChoiceDAO = surveyChoiceDAO;
	}

}
